import './themes';

import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { BrowserRouter as Router } from 'react-router-dom';

import store from './stores/configureStore';

import App from './container/App';

// 打印运行环境
console.log(process.env.NODE_ENV);

const Root = () => (
  <Provider store={ store }>
    <Router>
      <App />
    </Router>
  </Provider>
);

render(<Root />, document.getElementById('app'));

if (module.hot) {
  module.hot.accept('./reducers', () => {
    const nextRootReducer = require('./reducers');

    store.replaceReducer(nextRootReducer);
  });
  module.hot.accept();
}